home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol160 / alphamar.bas (.txt) next >
Encoding:
GW-BASIC  |  1986-12-16  |  4.7 KB  |  159 lines

  1. 90  WIDTH "scrn:", 80
  2. 95  SCREEN 0,1,0,0
  3. 100  TITLE$ = "Alphabetic List of Marriages"
  4. 105  TITLE$ = TITLE$ + " ON DISPLAY"
  5. 110  VERSION$ = "Version 3.1"
  6. 115  COPY1$ = "Copyright (c) 1983, 1984, 1985, by:"
  7. 120  COPY2$ = "Melvin O. Duke"
  8. 125  PRICE$ = "$35"
  9. 130  ADDR1$ = "Melvin O. Duke"
  10. 135  ADDR2$ = "P. O. Box 20836"
  11. 140  ADDR3$ = "San Jose, CA  95160"
  12. 145  REM Dimension Statements go here
  13. 150  DIM PERS.ID(400), MARR.ID(400), IDX$(400)
  14. 170  REM Produce the first screen
  15. 175  KEY OFF : CLS
  16. 180  REM Draw the outer double box
  17. 185  R1 = 1 : C1 = 1 : R2 = 24 : C2 = 79 : GOSUB 400
  18. 190  REM Find the title location
  19. 195  TITLE.POS = 40 - INT(LEN(TITLE$)/2)
  20. 200  REM Draw the title box
  21. 205  R1=3:C1=TITLE.POS-2:R2=6:C2=TITLE.POS+LEN(TITLE$)+1:GOSUB 600
  22. 210  REM Print the title
  23. 215  LOCATE 4,TITLE.POS : PRINT TITLE$
  24. 220  LOCATE 5,40-INT(LEN(VERSION$)/2) :  PRINT VERSION$;
  25. 225  REM Draw the Contribution box
  26. 230  R1 = 8 : C1 = 19 : R2 = 17 : C2 = 62 : GOSUB 400
  27. 235  REM Request the Contribution
  28. 240  LOCATE 9,23 : PRINT "If you are using these programs, and"
  29. 245  LOCATE 10,21 : PRINT "finding them of value, your contribution"
  30. 250  LOCATE 11,23 : PRINT "("+PRICE$+" suggested) will be anticipated."
  31. 255  REM Draw the Mailing Label
  32. 260  R1 = 12 : C1 = 28 : R2 = 16 : C2 = 52 : GOSUB 600
  33. 265  REM Print the Name and Address
  34. 270  LOCATE 13,40-INT(LEN(ADDR1$)/2) :  PRINT ADDR1$;
  35. 275  LOCATE 14,40-INT(LEN(ADDR2$)/2) :  PRINT ADDR2$;
  36. 280  LOCATE 15,40-INT(LEN(ADDR3$)/2) :  PRINT ADDR3$;
  37. 285  REM Draw the Copyright box
  38. 290  R1 = 19 : C1 = 21 : R2 = 22 : C2 = 59 : GOSUB 400
  39. 295  REM Print the Copyright
  40. 300  LOCATE 20,40-INT(LEN(COPY1$)/2) :  PRINT COPY1$;
  41. 305  LOCATE 21,40-INT(LEN(COPY2$)/2) :  PRINT COPY2$;
  42. 310  GOTO 740
  43. 400  REM subroutine to print a double box
  44. 405  COLOR 5
  45. 410  FOR I = R1 + 1 TO R2 - 1
  46. 420   LOCATE I, C1 : PRINT CHR$(186);
  47. 430   LOCATE I, C2 : PRINT CHR$(186);
  48. 440  NEXT I
  49. 450  FOR J = C1 + 1 TO C2 - 1
  50. 460   LOCATE R1, J : PRINT CHR$(205);
  51. 470   LOCATE R2, J : PRINT CHR$(205);
  52. 480  NEXT J
  53. 490   LOCATE R1, C1 : PRINT CHR$(201);
  54. 500   LOCATE R1, C2 : PRINT CHR$(187);
  55. 510   LOCATE R2, C1 : PRINT CHR$(200);
  56. 520   LOCATE R2, C2 : PRINT CHR$(188);
  57. 525  COLOR 7
  58. 530  RETURN
  59. 600  REM subroutine to print a single box
  60. 605  COLOR 3
  61. 610  FOR I = R1 + 1 TO R2 - 1
  62. 620   LOCATE I, C1 : PRINT CHR$(179);
  63. 630   LOCATE I, C2 : PRINT CHR$(179);
  64. 640  NEXT I
  65. 650  FOR J = C1 + 1 TO C2 - 1
  66. 660   LOCATE R1, J : PRINT CHR$(196);
  67. 670   LOCATE R2, J : PRINT CHR$(196);
  68. 680  NEXT J
  69. 690   LOCATE R1, C1 : PRINT CHR$(218);
  70. 700   LOCATE R1, C2 : PRINT CHR$(191);
  71. 710   LOCATE R2, C1 : PRINT CHR$(192);
  72. 720   LOCATE R2, C2 : PRINT CHR$(217);
  73. 725  COLOR 7
  74. 730  RETURN
  75. 740  REM ask user to press a key to continue
  76. 750  LOCATE 25,1
  77. 760  PRINT "Have Data Diskette(s) in Place, then Press any key to continue.";
  78. 770  K$ = INKEY$ : IF K$ = "" THEN 770
  79. 780  CLS
  80. 1000  REM Alphabetic List of Marriages.
  81. 1010  REM By:  Melvin O. Duke.  Last Updated:  11 August 1985.
  82. 1020  OPEN "a:persfile" AS #1 LEN = 256
  83. 1030  FIELD 1, 5 AS F1$, 20 AS F2$, 30 AS F3$, 2 AS F4$, 5 AS F5$, 5 AS F6$, 5 AS F7$, 11 AS F8$, 18 AS F9$, 16 AS F10$, 16 AS F11$, 11 AS F12$, 18 AS F13$, 16 AS F14$, 16 AS F15$, 11 AS F16$, 18 AS F17$, 16 AS F18$, 16 AS F19$
  84. 1040  REM Read the Marriage Index and then the Person File
  85. 1050  CLS
  86. 1060  OPEN "a:mindex" FOR INPUT AS #2
  87. 1070  INPUT #2, C
  88. 1080  LOCATE 19,1 : PRINT "There are:";C;"Marriage Index Records"
  89. 1090  FOR I = 1 TO C
  90. 1100   INPUT #2, PERS.ID(I), MARR.ID(I)
  91. 1110   LOCATE 23,1 : PRINT "Processing Marriage Index Record:";I,"Freespace";FRE(0)
  92. 1120   REM get the personal information
  93. 1130   GET #1, PERS.ID(I)
  94. 1140   REM Extract information from the file for use
  95. 1150   T2$ = F2$
  96. 1160   FOR J = 1 TO LEN(F2$) -1
  97. 1170    IF RIGHT$(T2$,1)=" " THEN T2$=LEFT$(T2$,LEN(T2$)-1) ELSE J=LEN(F2$)-1
  98. 1180   NEXT J
  99. 1190   T3$ = F3$
  100. 1200   FOR J = 1 TO LEN(F3$) -1
  101. 1210    IF RIGHT$(T3$,1)=" " THEN T3$=LEFT$(T3$,LEN(T3$)-1) ELSE J=LEN(F3$)-1
  102. 1220   NEXT J
  103. 1230   IDX$(I) = T2$+T3$
  104. 1240  NEXT I
  105. 1250  LOCATE 23,1 : PRINT SPACE$(79)
  106. 1260  REM Sort the index into ascending sequence
  107. 1270  REM
  108. 1280  FOR I = 1 TO 6
  109. 1290   B(I) = B(I-1)*4+1
  110. 1300   IF B(I) <= C/2 THEN K1 = I
  111. 1310  NEXT I
  112. 1320  B(K1) = INT(C/5)+1
  113. 1330  B(1) = 1
  114. 1340  FOR I = K1 TO 1 STEP -1
  115. 1350  LOCATE 23,1 : PRINT "Sorting Group:";I
  116. 1360   K1 = B(I)
  117. 1370   FOR J = K1 TO C
  118. 1380    LOCATE 23,20 : PRINT "J:";J;
  119. 1390    K2$ = IDX$(J) : TEMP1 = PERS.ID(J) : TEMP2 = MARR.ID(J)
  120. 1400    FOR K = J-K1 TO 0 STEP -K1
  121. 1410     LOCATE 23,30 : PRINT "K:";K, "Freespace:";FRE(0)
  122. 1420     IF K2$ > IDX$(K) THEN 1450
  123. 1430     IDX$(K+K1)=IDX$(K): PERS.ID(K+K1)=PERS.ID(K): MARR.ID(K+K1)=MARR.ID(K)
  124. 1440    NEXT K
  125. 1450    IDX$(K+K1)=K2$: PERS.ID(K+K1)=TEMP1: MARR.ID(K+K1)=TEMP2
  126. 1460   NEXT J
  127. 1470  NEXT I
  128. 1480  LOCATE 21,1 : PRINT "Printing the Alphabetical List"
  129. 1490  GOSUB 1510
  130. 1500  GOTO 1560
  131. 1510  LPRINT "   Alphabetic Listing of the Marriages File   ";DATE$;"   ";TIME$
  132. 1520  LPRINT
  133. 1530  LPRINT "  REC    SURNAME             GIVEN-NAMES";TAB(60);"BIRTHDATE"
  134. 1540  LPRINT "  ---    -------             -----------";TAB(60);"---------"
  135. 1550  RETURN
  136. 1560  REM Read all records, and print the actual ones
  137. 1570  K = 0
  138. 1580  LOCATE 23,1 : PRINT SPACE$(79)
  139. 1590  FOR I = 1 TO C
  140. 1600   GET #1, ABS(PERS.ID(I))
  141. 1610   LOCATE 23,1 : PRINT "Printing Record:"; I, "Freespace:";FRE(0)
  142. 1620   REM Print the information in Alphabetical Order.
  143. 1630   T1 = CVS(F1$)
  144. 1640   IF T1 < 1 THEN 1710
  145. 1650   K = K + 1
  146. 1660   T2$ = F2$
  147. 1670   T3$ = F3$
  148. 1675   T8$ = F8$
  149. 1680   LPRINT USING "#####";MARR.ID(I);
  150. 1690   LPRINT TAB(10); T2$; T3$; TAB(60); T8$
  151. 1700   IF K MOD 55 = 0 THEN LPRINT CHR$(12);: GOSUB 1510
  152. 1710  NEXT I
  153. 1720  CLOSE #1
  154. 1730  CLOSE #2
  155. 1740  CLS : LOCATE 21,1
  156. 1750  PRINT "End of Program
  157. 1760  LPRINT CHR$(12);
  158. 1770  RUN "a:menu"
  159.